home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / MATH / FSULTRA1.ZIP / ULTRA_LH.ASM < prev    next >
Assembly Source File  |  1992-06-18  |  3KB  |  138 lines

  1. comment ! 
  2. FSU - ULTRA    The greatest random number generator that ever was
  3.         or ever will be.  Way beyond Super-Duper.
  4.         (Just kidding, but we think its a good one.)
  5.  
  6. Authors:    Arif Zaman (arif@stat.fsu.edu) and
  7.         George Marsaglia (geo@stat.fsu.edu).
  8.  
  9. Date:        27 May 1992
  10.  
  11. Version:    1.05
  12.  
  13. Copyright:    To obtain permission to incorporate this program into
  14.         any commercial product, please contact the authors at
  15.         the e-mail address given above or at
  16.  
  17.         Department of Statistics and
  18.         Supercomputer Computations Research Institute
  19.         Florida State University
  20.         Tallahassee, FL 32306.
  21.  
  22. See Also:    README        for a brief description
  23.         ULTRA.DOC    for a detailed description
  24.  
  25. -----------------------------------------------------------------------
  26. ;
  27. ; File: ULTRA.ASM (Lahey Fortran calling conventions)
  28. ;
  29.    DOSSEG
  30.    .MODEL HUGE
  31.  
  32. ;===== B: GLOBAL FUNCTIONS, SUBROUTINES and VARIABLES =================
  33. ;
  34.     public  i31bit, i15bit, i7bit,  i1bit,  uni,    duni
  35.     public  i32bit, i16bit, i8bit,  rinit,  vni,    dvni
  36.     public    swbstate, swbsize
  37.  
  38. ;===== D. MACRO DEFINITIONS ===========================================
  39. ;
  40. ; RinitProcStart should take two 32-bit arguments conx and shrx
  41. ;   and place them in the data segment in congx and shrgx.
  42. ;   es and ds should both point to the data segment.
  43. ;   conx must be odd (so we or with 1 just to make sure).
  44. ; FillProc
  45. ;   DS is already the data segment. ES should also be made the same.
  46.  
  47. EnterProcedure   macro
  48.     arg  arg1:dword
  49.     push bp
  50.     mov  bp,sp
  51.     if @DataSize eq 2
  52.       mov  dx,DATA
  53.       mov  ds,dx
  54.     endif
  55. endm
  56.  
  57. ExitProcedure    macro
  58.     pop  bp
  59.     ret
  60. endm
  61.  
  62. Enter2arg   macro
  63.     arg conx:dword, shrx:dword
  64.     EnterProcedure
  65.     mov  dx,ds
  66.     mov  es,dx
  67.     mov  di,offset congx
  68.     lds  si,ConX            ; Store the parameters in
  69.     lodsw                   ; the data segment in
  70.     shl  ax,1
  71.     stosw                   ; conglo:conghi and
  72.     lodsw                   ; shrglo:shrghi.
  73.     rcl  ax,1
  74.     stosw
  75.     mov  di,offset shrgx
  76.     lds  si,ShrX
  77.     lodsw
  78.     stosw
  79.     lodsw
  80.     stosw
  81.     mov  ds,dx              ; setup the segment regs.
  82.     or   byte ptr congx,1
  83. endm
  84.  
  85. Exit2arg     macro
  86.     ExitProcedure
  87. endm
  88.  
  89. EnterFill    macro
  90.     mov    ax,ds
  91.     mov    es,ax
  92. endm
  93.  
  94. ExitFill    macro
  95.     ret
  96. endm
  97.  
  98. DwordFn macro
  99.     les di,arg1
  100.     stosw
  101.     mov ax,dx
  102.     stosw
  103. endm
  104.  
  105. WordFn  macro
  106.     les di,arg1
  107.     stosw
  108. endm
  109.  
  110. ByteFn  macro
  111.     les di,arg1
  112.     cbw                 ; convert bytes to integer*2
  113.     stosw
  114. endm
  115.  
  116. RealFn  macro
  117.     lds  bx,arg1
  118.     fstp dword ptr [bx]
  119. endm
  120.  
  121. DoubleFn macro
  122.     lds  bx,arg1
  123.     fstp qword ptr [bx]
  124. endm
  125.  
  126. DGROUP GROUP DATA
  127. DATA SEGMENT WORD PUBLIC 'DATA'
  128. ASSUME DS:DGROUP
  129.   INCLUDE ULTRADAT.INC
  130. DATA ENDS
  131.  
  132. .STACK 10h
  133.  
  134. .CODE
  135.   INCLUDE ULTRACOD.INC
  136. END
  137.